{extend name="v1/layout/base"}
{block name="content"}
<div class="layui-row layui-col-space15">
  <div class="layui-col-md12">
      <form class="layui-card-body layui-form layui-form-pane">
        <div class="layui-row layui-col-space10 layui-form-item">
          <div class="layui-col-lg8">
            <label class="layui-form-label">菜单名称：</label>
            <div class="layui-input-block">
              <input type="text" name="menu_name" value="{$info.menu_name}" lay-verify="required" lay-reqtext="请输入菜单名称" placeholder="请输入菜单名称" autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-row layui-col-space10 layui-form-item">
          <div class="layui-col-lg8">
            <label class="layui-form-label">菜单图标：</label>
            <div class="layui-input-block">
              <input type="text" name="icon" value="{$info.icon}"  placeholder="请输入菜单图标" autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-row layui-col-space10 layui-form-item">
          <div class="layui-col-lg8">
            <label class="layui-form-label">菜单标志：</label>
            <div class="layui-input-block">
              <input type="text" name="sign" value="{$info.sign}"  placeholder="请输入菜单标志，不填默认为菜单名称拼音" autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-row layui-col-space10 layui-form-item">
          <div class="layui-col-lg8">
            <label class="layui-form-label">所属上级菜单：</label>
            <div class="layui-input-block">
              <select name="parent_id" lay-verify="required" lay-reqtext="请选择所属配置" lay-search>
                <option value="0">系统平台</option>
                {volist name="$menu_list" id="vo"}
                <option {if condition="$vo['parent_id'] eq $info['menu_id'] || $vo['cate_id'] eq $info['menu_id']" }
                    disabled="disabled" {/if} {$info['parent_id']==$vo['menu_id']?'selected':''} value="{$vo.menu_id}">{$vo.prefix}{$vo.menu_name}</option>
                {/volist}
              </select>
            </div>
          </div>
        </div>
        <div class="layui-row layui-col-space10 layui-form-item">
          <div class="layui-col-lg8">
            <label class="layui-form-label">菜单控制器：</label>
            <div class="layui-input-block">
              <input type="text" name="menu_controller" lay-verify="required" lay-reqtext="请填写菜单关联控制器"  placeholder="请输入菜单控制器" value="{$info.menu_controller}" autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-row layui-col-space10 layui-form-item">
          <div class="layui-col-lg8">
            <label class="layui-form-label">菜单方法：</label>
            <div class="layui-input-block">
              <input type="text" name="menu_action" value="{$info.menu_action}"  placeholder="请输入菜单方法，一级菜单可不填" autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-row layui-col-space10 layui-form-item">
          <div class="layui-col-lg8">
            <label class="layui-form-label">菜单链接：</label>
            <div class="layui-input-block">
              <input type="text" name="linkurl" value="{$info.linkurl}"  placeholder="请输入菜单链接，默认系统生成" autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-row layui-col-space10 layui-form-item">
          <div class="layui-col-lg8">
            <label class="layui-form-label">排序编号：</label>
            <div class="layui-input-block">
              <input type="number" name="order_id" value="{$info.order_id}"  placeholder="请输入菜单编号" autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-row layui-col-space10 layui-form-item">
          <div class="layui-col-lg8">
            <label class="layui-form-label">是否显示：</label>
            <div class="layui-input-block">
              <input type="radio" name="status" value="1" title="显示" {$info['status']==1?'checked':''}>
              <input type="radio" name="status" value="0" title="不显示" {$info['status']==0?'checked':''}>
            </div>
          </div>
        </div>
        <!-- 底部操作按钮 -->
        <div class="layui-row">
          <div class="layui-col-xs3">&nbsp;</div>
          <div class="layui-col-xs4">
            <input type="hidden" name="act" value="edit" />
            <input type="hidden" name="menu_id" value="{$info.menu_id}">
            <button type="button" class="layui-btn layui-btn-primary layui-btn-radius" id="infoBackList"><i class="layui-icon">&#xe65c;</i>返回列表</button>
            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit lay-filter="saveBtn"><i class="layui-icon">&#xe609;</i>立即更新</button>
          </div>
          <div class="layui-col-xs5">&nbsp;</div>
        </div>
        <!-- 底部操作按钮结束 -->
      </form>
  </div>
</div>
{/block}
{block name="myScript"}
<script>
  layui.use(['form'], function() {
    var form = layui.form,
      layer = layui.layer,
      $ = layui.$;
    //监听提交
    form.on('submit(saveBtn)', function(data) {
      var data = data.field,
          url = "{:url('/'.config('manage.manage_name').'/'.config('manage.version').'/System/menuSave')}";
      https(url, data, 'post', 1, '正在保存信息').then(res => {
        xkTreeMsg(res.result_msg);
      }, fail => {})
      return false;
    });
  });
</script>
{/block}
